package com.sitech.oncon.barcode.core;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebSettings;
import android.webkit.WebView;

import com.ykdl.member.constant.KidAction;
import com.ykdl.member.constant.KidConfig;
import com.ykdl.member.kid.R;
import com.ykdl.member.kid.gears.WebViewActivity;
import com.ykdl.member.kid.util.AccessTokenKeeper;

public class CodeWebviewActivity  extends WebViewActivity{
	private static AccessTokenKeeper mTokenKeeper;
	private String point_role_id ;
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		goneButton();
	}
	@Override
	protected void getIntentData() {
		// TODO Auto-generated method stub
		point_role_id = this.getIntent().getStringExtra(KidAction.CARD_POINT);
	}

	@Override
	protected void setWapTitle() {
		// TODO Auto-generated method stub
//		String title = "名医讲堂";
//		tv_title.setText(title);
	}

	@Override
	protected void startLoadUrl() {
		// TODO Auto-generated method stub
		mTokenKeeper = new AccessTokenKeeper(this);
		String url1=KidConfig.GOODS_STATIC_PAGE;
		String url= url1+point_role_id+"?"+mTokenKeeper.getmAccessTokenTitle()+"="+mTokenKeeper.getmAccessToken();
		webView.loadUrl(url);
	}

	@Override
	protected boolean overrideUrlLoading(WebView view, String url) {
		// TODO Auto-generated method stub
		return false;
	}
	/*private static AccessTokenKeeper mTokenKeeper;
	private String article_id ;
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setTopTitle("名师讲堂", 0, R.drawable.back_bg, new OnClickListener() {
			@Override
			public void onClick(View v) {
				
				finish();
			}
		}, 0, 0, null, R.drawable.title_bg, false);
		article_id = this.getIntent().getStringExtra(KidAction.ARTICLE_ID);
		setContent(R.layout.useragreecomentactivity_xml);
		mTokenKeeper = new AccessTokenKeeper(this);
		inint();
	}
	
	private void inint() {
		String url1=KidConfig.ARTICLES_INFO;
		String url= url1+"/"+article_id+"?"+mTokenKeeper.getmAccessTokenTitle()+"="+mTokenKeeper.getmAccessToken();
		WebView webView =  (WebView)findViewById(R.id.webView);
		WebSettings webSettings = webView.getSettings();
		webSettings.setSavePassword(false);
        webSettings.setSaveFormData(false);
        webSettings.setJavaScriptEnabled(true);
        webSettings.setSupportZoom(false);
		webView.loadUrl(url);
//		setTopNav(webView.getTitle());
		
	}*/
}
